<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
    <head>
        <jsp:include page="../WEB-INF/jspf/header.jsp" >
            <jsp:param name="title" value="Add Book" />
        </jsp:include>
    </head>
    <body>
        <jsp:include page="../WEB-INF/jspf/beforeWork.jsp" >
            <jsp:param name="addBook" value="" />
        </jsp:include>

        <c:if test="${not empty error}">
            <div id="error">
                <c:out value="${error}"/>
            </div>
        </c:if>

        <form action="${pageContext.request.contextPath}/AddBook" method="post">
            <h3>Please enter information about new book:</h3>
            <table>
                <tr>
                    <th>Name</th>
                    <td><input type="text" name="name" value="${book.name}"/></td>
                </tr>
                <tr>
                    <th>Author's surname</th>
                    <td><input type="text" name="author" value="${book.author.surname}"/></td>
                </tr>
                <tr>
                    <th>Published</th>
                    <td><input type="text" name="published" value="${published}"/>accepted format: MM-dd-yyyy</td>
                </tr>
                <tr>
                    <th>Fiction</th>
                    <td><input type="checkbox" name="fiction" value="on"/></td>
                </tr>
            </table>
            <p><input type="Submit" value="Add author" /></p>
        </form>

        <jsp:include page="../WEB-INF/jspf/afterWork.jsp" />
    </body>
</html>